/*
 * $Id: CfgRequestType.java,v 1.8 2009/07/24 18:27:41 oliver Exp $
 *
 * Copyright (C) 2006 General Electric Company. All Rights Reserved.
 *
 * This software is the confidential and proprietary information of the General
 * Electric Company (GE). You shall not disclose this software and shall use it
 * only in accordance with the terms of the license agreement you entered into
 * with GE.
 *
 * GE MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
 * NON-INFRINGEMENT. GE SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE
 * AS A RESULT OF USING, MODIFYING, OR DISTRIBUTING THIS SOFTWARE OR ITS
 * DERIVATIVES.
 */

package com.ge.healthcare.autosc.common.database.pojo;

public class CfgRequestType extends AbstractCfgRequestType {
	/**
	 * Eclipse generated
	 */
	private static final long serialVersionUID = -7131294374000160154L;

	public static final String TABLE_NAME = "com.ge.healthcare.autosc.common.database.pojo.CfgRequestType";

	public static final String COL_REQUEST_TYPE_ID = "requestTypeId";
	public static final String COL_REQUEST_TYPE_NAME = "requestTypeName";
	public static final String COL_IS_REQUESTABLE = "isRequestable";
	
	public boolean equals (CfgRequestType requestType){
		if( this.getRequestTypeId().equals(requestType.getRequestTypeId()) && 
				this.getRequestTypeName().equals(requestType.getRequestTypeName())){
			return true;
		}
		return false;
	}
	
	public void setRequestable(boolean isRequestable){
		if (isRequestable){
			this.setIsRequestable("Y");
		}else{
			this.setIsRequestable("N");
		}
	}
	
	public String toString(){
		StringBuffer definition = new StringBuffer();
		definition.append("{Request Type Id=").append(this.getRequestTypeId()).append("},");
		definition.append("{Request Type Name=").append(this.getRequestTypeName()).append("},");
		definition.append("{Is Requestable=").append(this.getIsRequestable()).append("}");
		return definition.toString();
	}

	public boolean matchRequestType(String requestTypeName) {
		return (getRequestTypeName().equals(requestTypeName));
	}
	
}
